home *** CD-ROM | disk | FTP | other *** search
/ Star Trek Starfleet Academy Mini Omnipedia / MINI_OMNI.ISO / pc / omni_v2.dxr / 00420_Misc. Topic Edit Handlers.ls < prev    next >
Encoding:
Text File  |  1996-04-15  |  3.1 KB  |  95 lines

  1. global gOurFontK, gInscScrollFldK, gDirectOrFolderK, oImport, gAddField, gDeleteField
  2.  
  3. on hPrepTopicEdit
  4.   set gAddField to the number of cast "TopicAddText"
  5.   set gDeleteField to the number of cast "TopicDeleteText"
  6. end
  7.  
  8. on hFieldEditClick pLine, pCast
  9.   global gTopicEditMode, oImport, gDeleteLine
  10.   set vtext to line pLine of field pCast
  11.   if the shiftDown then
  12.     if the textStyle of line pLine of field pCast = "Bold" then
  13.       set the textStyle of line pLine of field pCast to "Plain"
  14.     else
  15.       set the textStyle of line pLine of field pCast to "Bold"
  16.     end if
  17.   else
  18.     if the doubleClick then
  19.       if the textStyle of line pLine of field pCast = "Bold" then
  20.         if gTopicEditMode = #add then
  21.           mStartUserImport(oImport)
  22.         else
  23.           set gDeleteLine to pLine
  24.           set vClickName to line pLine of field gDeleteField
  25.           put vClickName into field "DeleteNameField"
  26.           if vClickName <> EMPTY then
  27.             go("OKTODELETE")
  28.           end if
  29.         end if
  30.       else
  31.         set the textStyle of field pCast to "plain"
  32.         set the textStyle of line pLine of field pCast to "Bold"
  33.       end if
  34.     else
  35.       set the textStyle of field pCast to "plain"
  36.       set the textStyle of line pLine of field pCast to "Bold"
  37.     end if
  38.   end if
  39. end
  40.  
  41. on hGetAddList
  42.   global oFile
  43.   set vFileList to mGetFolderFiles(oFile, the pathName & "Userarts" & mGetFileDelimiter(oFile))
  44.   if vFileList = EMPTY then
  45.     mReport(oImport, "No files available from" && gDirectOrFolderK && "USERARTS")
  46.   else
  47.     mReport(oImport, "Available files from" && gDirectOrFolderK && "USERARTS")
  48.   end if
  49.   set vtext to EMPTY
  50.   set vListlen to count(vFileList)
  51.   if vListlen > 0 then
  52.     repeat with x = 1 to vListlen
  53.       put getAt(vFileList, x) into line x of vtext
  54.     end repeat
  55.   end if
  56.   if vtext = EMPTY then
  57.     set vtext to "."
  58.   end if
  59.   put vtext into field gAddField
  60.   set the textFont of field gAddField to gOurFontK
  61.   set the textHeight of cast gAddField to 13
  62.   set the textStyle of field gAddField to "plain"
  63.   hPromptText("Select an article to add to the TOPICS mode by clicking on its filename. (Hold down the shift key, or click SELECT ALL below, to select more than one file.)" & RETURN & RETURN & "Click RESUME to continue with main program.")
  64. end
  65.  
  66. on hGetKillList
  67.   set vFullList to mGrabCurrAttrList(oIndexMediator, #TOPICS)
  68.   set vListlen to count(vFullList)
  69.   set vtext to EMPTY
  70.   set vLine to 1
  71.   repeat with x = 1 to vListlen
  72.     set vName to getPropAt(vFullList, x)
  73.     if vName starts "‚Ä¢" then
  74.       put vName into line vLine of vtext
  75.       set vLine to vLine + 1
  76.     end if
  77.   end repeat
  78.   if vtext = EMPTY then
  79.     set vtext to "."
  80.   end if
  81.   put vtext into field gDeleteField
  82.   if vtext = "." then
  83.     mReport(oImport, "No user articles to be deleted...")
  84.   else
  85.     mReport(oImport, "Select user articles to be deleted...")
  86.   end if
  87.   set the textFont of field gDeleteField to gOurFontK
  88.   set the textHeight of cast gDeleteField to 13
  89.   set the textStyle of field gDeleteField to "plain"
  90. end
  91.  
  92. on hPromptText pTextplease
  93.   set the text of field "userarts prompts" to pTextplease
  94. end
  95.